//导入request.js请求工具
import request from '@/utils/request.js'

//发送验证码
export const codeService = (email,methods) => {
    return request({
        url: '/user/sendCode',
        method: 'get',
        params: {
            email,
            methods
        }
    })
}

export const registerService = (data) => {
    return request({
        url: '/user/register',
        method: 'post',
        data
    })
}

export const loginService = (data) => {
    return request({
        url: '/user/login',
        method: 'post',
        data
    })
}

export const resetPwdService = (data) => {
    return request({
        url: '/user/resetPwd',
        method: 'post',
        data
    })
}

export const getUserInfoService = () => {
    return request({
        url: '/user/userInfo',
        method: 'get'
    })
}

export const perfectUserInfoService = (data) => {
    return request({
        url: '/user/perfectUserInfo',
        method: 'put',
        data
    })
}

export const resetEmailService = (data) =>{
    return request({
        url: '/user/resetEmail',
        method: 'put',
        data
    })
}